package com.noble.meether.chat.ui.agora.act.dialog.report;

import android.widget.RelativeLayout;
import android.widget.TextView;

import com.noble.meether.R;
import com.noble.glamour.module.logic.application.App;
import com.noble.library.widget.RecyclerView.base.BaseRecyclerViewAdapter;
import com.noble.library.widget.RecyclerView.base.BaseRecyclerViewHolder;
import com.noble.meether.chat.ui.agora.act.bean.RtcComplainReasons;

/**
 * 投诉Adpter
 */
public class ReportAdapter extends BaseRecyclerViewAdapter<RtcComplainReasons.Complain> {
    private int selectPosition;

    @Override
    public int[] getItemLayouts() {
        return new int[]{R.layout.item_video_report};
    }

    @Override
    public void onBindRecycleViewHolder(BaseRecyclerViewHolder viewHolder, final int position) {
        final RtcComplainReasons.Complain data = getItem(position);

        TextView tv_issue = viewHolder.findViewById(R.id.tv_issue);
        RelativeLayout item_issue = viewHolder.findViewById(R.id.item_issue);

        tv_issue.setText(data.getReason());     // 话题
        item_issue.setBackground(null);

        tv_issue.setTextColor(App.context.getResources().getColor(R.color.gray_text));
        if (this.selectPosition == position) {
            tv_issue.setTextColor(App.context.getResources().getColor(R.color.white));
            item_issue.setBackgroundResource(R.drawable.rectangle_shape_blue15);
        }
    }


    public void setSelected(int position) {
        this.selectPosition = position;
    }

    @Override
    public int getRecycleViewItemType(int position) {
        return 0;
    }
}

